<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CryptoAuthLib: TNG API (tng_)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CryptoAuthLib
   </div>
   <div id="projectbrief">Microchip CryptoAuthentication Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00997.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">TNG API (tng_)</div>  </div>
</div><!--header-->
<div class="contents">

<p>These methods provide some convenience functions (mostly around certificates) for TNG devices, which currently include ATECC608A-MAH22-T and ATECC608A-MAHTN-T.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gadc3504154ad83e140440f65534c15c63"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#gadc3504154ad83e140440f65534c15c63">TNG22_PRIMARY_KEY_SLOT</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:gadc3504154ad83e140440f65534c15c63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7f5e2986348fe1200f43e5456dd90cc7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga7f5e2986348fe1200f43e5456dd90cc7">TNGTN_PRIMARY_KEY_SLOT</a>&#160;&#160;&#160;1</td></tr>
<tr class="separator:ga7f5e2986348fe1200f43e5456dd90cc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga91acea350b146040fc32c64eac8054f7"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga91acea350b146040fc32c64eac8054f7">tng_type_t</a> { <a class="el" href="a00997.html#gga91acea350b146040fc32c64eac8054f7a5b74509d0d64689d7acb7abf01a60f3e">TNGTYPE_UNKNOWN</a>, 
<a class="el" href="a00997.html#gga91acea350b146040fc32c64eac8054f7a977c3f9fab34c7b46991dc1b2c84cb56">TNGTYPE_22</a>, 
<a class="el" href="a00997.html#gga91acea350b146040fc32c64eac8054f7a08422f2a9b83a26469ab56fa3f3cfa7c">TNGTYPE_TN</a>
 }</td></tr>
<tr class="separator:ga91acea350b146040fc32c64eac8054f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga421d9b1fd3aba60c947d6b3efb122390"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00173.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga421d9b1fd3aba60c947d6b3efb122390">tng_get_type</a> (<a class="el" href="a00997.html#ga91acea350b146040fc32c64eac8054f7">tng_type_t</a> *type)</td></tr>
<tr class="memdesc:ga421d9b1fd3aba60c947d6b3efb122390"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the type of TNG device.  <a href="#ga421d9b1fd3aba60c947d6b3efb122390">More...</a><br /></td></tr>
<tr class="separator:ga421d9b1fd3aba60c947d6b3efb122390"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6bdd6b8ace7a98b7efbc13f85ffaac1a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00173.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga6bdd6b8ace7a98b7efbc13f85ffaac1a">tng_get_device_pubkey</a> (uint8_t *public_key)</td></tr>
<tr class="memdesc:ga6bdd6b8ace7a98b7efbc13f85ffaac1a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Uses GenKey command to calculate the public key from the primary device public key.  <a href="#ga6bdd6b8ace7a98b7efbc13f85ffaac1a">More...</a><br /></td></tr>
<tr class="separator:ga6bdd6b8ace7a98b7efbc13f85ffaac1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaecb2b4ecc54a70681f2f254f26b5a7e3"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="a00990.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#gaecb2b4ecc54a70681f2f254f26b5a7e3">g_tng22_cert_def_1_signer</a></td></tr>
<tr class="separator:gaecb2b4ecc54a70681f2f254f26b5a7e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7f91d8121c07bfeea37599ddaf73d7b7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga7f91d8121c07bfeea37599ddaf73d7b7">TNG22_CERT_TEMPLATE_1_SIGNER_SIZE</a>&#160;&#160;&#160;520</td></tr>
<tr class="separator:ga7f91d8121c07bfeea37599ddaf73d7b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga40641ac9348b3b54bb30ba27a52a5a0e"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="a00990.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga40641ac9348b3b54bb30ba27a52a5a0e">g_tng22_cert_def_2_device</a></td></tr>
<tr class="separator:ga40641ac9348b3b54bb30ba27a52a5a0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8c8988bd24bd5cab2ec8571bf96fef25"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga8c8988bd24bd5cab2ec8571bf96fef25">TNG22_CERT_TEMPLATE_2_DEVICE_SIZE</a>&#160;&#160;&#160;505</td></tr>
<tr class="separator:ga8c8988bd24bd5cab2ec8571bf96fef25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaae6e9895b4de628dbdf01c881b039488"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#gaae6e9895b4de628dbdf01c881b039488">TNG22_CERT_ELEMENTS_2_DEVICE_COUNT</a>&#160;&#160;&#160;2</td></tr>
<tr class="separator:gaae6e9895b4de628dbdf01c881b039488"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga67606649a5f2261cb6b55478d72bf805"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga67606649a5f2261cb6b55478d72bf805">tng_atcacert_max_device_cert_size</a> (size_t *max_cert_size)</td></tr>
<tr class="memdesc:ga67606649a5f2261cb6b55478d72bf805"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the maximum possible certificate size in bytes for a TNG device certificate. Certificate can be variable size, so this gives an appropriate buffer size when reading the certificate.  <a href="#ga67606649a5f2261cb6b55478d72bf805">More...</a><br /></td></tr>
<tr class="separator:ga67606649a5f2261cb6b55478d72bf805"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga22c7ea083197410f396d18fa808e8e0c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga22c7ea083197410f396d18fa808e8e0c">tng_atcacert_read_device_cert</a> (uint8_t *cert, size_t *cert_size, const uint8_t *signer_cert)</td></tr>
<tr class="memdesc:ga22c7ea083197410f396d18fa808e8e0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the device certificate for a TNG device.  <a href="#ga22c7ea083197410f396d18fa808e8e0c">More...</a><br /></td></tr>
<tr class="separator:ga22c7ea083197410f396d18fa808e8e0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga01bf19754baee6ce82ec46f966528262"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga01bf19754baee6ce82ec46f966528262">tng_atcacert_device_public_key</a> (uint8_t *public_key, uint8_t *cert)</td></tr>
<tr class="memdesc:ga01bf19754baee6ce82ec46f966528262"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the device public key.  <a href="#ga01bf19754baee6ce82ec46f966528262">More...</a><br /></td></tr>
<tr class="separator:ga01bf19754baee6ce82ec46f966528262"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga857aacbb70f2ea18411f1ca478a0e37f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga857aacbb70f2ea18411f1ca478a0e37f">tng_atcacert_max_signer_cert_size</a> (size_t *max_cert_size)</td></tr>
<tr class="memdesc:ga857aacbb70f2ea18411f1ca478a0e37f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the maximum possible certificate size in bytes for a TNG signer certificate. Certificate can be variable size, so this gives an appropriate buffer size when reading the certificate.  <a href="#ga857aacbb70f2ea18411f1ca478a0e37f">More...</a><br /></td></tr>
<tr class="separator:ga857aacbb70f2ea18411f1ca478a0e37f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga82d3c529ed81119a956957052c06e8d7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga82d3c529ed81119a956957052c06e8d7">tng_atcacert_read_signer_cert</a> (uint8_t *cert, size_t *cert_size)</td></tr>
<tr class="memdesc:ga82d3c529ed81119a956957052c06e8d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the signer certificate for a TNG device.  <a href="#ga82d3c529ed81119a956957052c06e8d7">More...</a><br /></td></tr>
<tr class="separator:ga82d3c529ed81119a956957052c06e8d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa4c31ab35807d8ed51fbecc48866aa04"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#gaa4c31ab35807d8ed51fbecc48866aa04">tng_atcacert_signer_public_key</a> (uint8_t *public_key, uint8_t *cert)</td></tr>
<tr class="memdesc:gaa4c31ab35807d8ed51fbecc48866aa04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the signer public key.  <a href="#gaa4c31ab35807d8ed51fbecc48866aa04">More...</a><br /></td></tr>
<tr class="separator:gaa4c31ab35807d8ed51fbecc48866aa04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa3a0387ff2a71684a2992d4661c53331"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#gaa3a0387ff2a71684a2992d4661c53331">tng_atcacert_root_cert_size</a> (size_t *cert_size)</td></tr>
<tr class="memdesc:gaa3a0387ff2a71684a2992d4661c53331"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the size of the TNG root cert.  <a href="#gaa3a0387ff2a71684a2992d4661c53331">More...</a><br /></td></tr>
<tr class="separator:gaa3a0387ff2a71684a2992d4661c53331"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga31cf63afba3c936d279a325d71691a68"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga31cf63afba3c936d279a325d71691a68">tng_atcacert_root_cert</a> (uint8_t *cert, size_t *cert_size)</td></tr>
<tr class="memdesc:ga31cf63afba3c936d279a325d71691a68"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the TNG root cert.  <a href="#ga31cf63afba3c936d279a325d71691a68">More...</a><br /></td></tr>
<tr class="separator:ga31cf63afba3c936d279a325d71691a68"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8cd0d450da1bf23d0f6784446d35c556"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga8cd0d450da1bf23d0f6784446d35c556">tng_atcacert_root_public_key</a> (uint8_t *public_key)</td></tr>
<tr class="memdesc:ga8cd0d450da1bf23d0f6784446d35c556"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the root public key.  <a href="#ga8cd0d450da1bf23d0f6784446d35c556">More...</a><br /></td></tr>
<tr class="separator:ga8cd0d450da1bf23d0f6784446d35c556"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5c01e37d1f10dbf90d50208cbc5bc8ab"><td class="memItemLeft" align="right" valign="top">const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga5c01e37d1f10dbf90d50208cbc5bc8ab">g_cryptoauth_root_ca_002_cert</a> []</td></tr>
<tr class="separator:ga5c01e37d1f10dbf90d50208cbc5bc8ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabff789f84f8f178a30ce06792fe47771"><td class="memItemLeft" align="right" valign="top">const size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#gabff789f84f8f178a30ce06792fe47771">g_cryptoauth_root_ca_002_cert_size</a></td></tr>
<tr class="separator:gabff789f84f8f178a30ce06792fe47771"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9d67f287321c5821711e9cc0ef332b3b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga9d67f287321c5821711e9cc0ef332b3b">CRYPTOAUTH_ROOT_CA_002_PUBLIC_KEY_OFFSET</a>&#160;&#160;&#160;266</td></tr>
<tr class="separator:ga9d67f287321c5821711e9cc0ef332b3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0aa08fbe28f95e963992360b558df183"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="a00990.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#ga0aa08fbe28f95e963992360b558df183">g_tngtn_cert_def_1_signer</a></td></tr>
<tr class="separator:ga0aa08fbe28f95e963992360b558df183"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa57e70cff7fe086c68527e2e8b284074"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="a00990.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00997.html#gaa57e70cff7fe086c68527e2e8b284074">g_tngtn_cert_def_2_device</a></td></tr>
<tr class="separator:gaa57e70cff7fe086c68527e2e8b284074"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>These methods provide some convenience functions (mostly around certificates) for TNG devices, which currently include ATECC608A-MAH22-T and ATECC608A-MAHTN-T. </p>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga9d67f287321c5821711e9cc0ef332b3b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9d67f287321c5821711e9cc0ef332b3b">&#9670;&nbsp;</a></span>CRYPTOAUTH_ROOT_CA_002_PUBLIC_KEY_OFFSET</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CRYPTOAUTH_ROOT_CA_002_PUBLIC_KEY_OFFSET&#160;&#160;&#160;266</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="gaae6e9895b4de628dbdf01c881b039488"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaae6e9895b4de628dbdf01c881b039488">&#9670;&nbsp;</a></span>TNG22_CERT_ELEMENTS_2_DEVICE_COUNT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TNG22_CERT_ELEMENTS_2_DEVICE_COUNT&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ga7f91d8121c07bfeea37599ddaf73d7b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7f91d8121c07bfeea37599ddaf73d7b7">&#9670;&nbsp;</a></span>TNG22_CERT_TEMPLATE_1_SIGNER_SIZE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TNG22_CERT_TEMPLATE_1_SIGNER_SIZE&#160;&#160;&#160;520</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ga8c8988bd24bd5cab2ec8571bf96fef25"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8c8988bd24bd5cab2ec8571bf96fef25">&#9670;&nbsp;</a></span>TNG22_CERT_TEMPLATE_2_DEVICE_SIZE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TNG22_CERT_TEMPLATE_2_DEVICE_SIZE&#160;&#160;&#160;505</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="gadc3504154ad83e140440f65534c15c63"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadc3504154ad83e140440f65534c15c63">&#9670;&nbsp;</a></span>TNG22_PRIMARY_KEY_SLOT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TNG22_PRIMARY_KEY_SLOT&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ga7f5e2986348fe1200f43e5456dd90cc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7f5e2986348fe1200f43e5456dd90cc7">&#9670;&nbsp;</a></span>TNGTN_PRIMARY_KEY_SLOT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define TNGTN_PRIMARY_KEY_SLOT&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga91acea350b146040fc32c64eac8054f7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga91acea350b146040fc32c64eac8054f7">&#9670;&nbsp;</a></span>tng_type_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="a00997.html#ga91acea350b146040fc32c64eac8054f7">tng_type_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga91acea350b146040fc32c64eac8054f7a5b74509d0d64689d7acb7abf01a60f3e"></a>TNGTYPE_UNKNOWN&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="gga91acea350b146040fc32c64eac8054f7a977c3f9fab34c7b46991dc1b2c84cb56"></a>TNGTYPE_22&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="gga91acea350b146040fc32c64eac8054f7a08422f2a9b83a26469ab56fa3f3cfa7c"></a>TNGTYPE_TN&#160;</td><td class="fielddoc"></td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga01bf19754baee6ce82ec46f966528262"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga01bf19754baee6ce82ec46f966528262">&#9670;&nbsp;</a></span>tng_atcacert_device_public_key()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int tng_atcacert_device_public_key </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>public_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>cert</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads the device public key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">public_key</td><td>Public key will be returned here. Format will be the X and Y integers in big-endian format. 64 bytes for P256 curve. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cert</td><td>If supplied, the device public key is used from this certificate. If set to NULL, the device public key is read from the device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ATCACERT_E_SUCCESS on success, otherwise an error code. </dd></dl>

</div>
</div>
<a id="ga67606649a5f2261cb6b55478d72bf805"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga67606649a5f2261cb6b55478d72bf805">&#9670;&nbsp;</a></span>tng_atcacert_max_device_cert_size()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int tng_atcacert_max_device_cert_size </td>
          <td>(</td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>max_cert_size</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the maximum possible certificate size in bytes for a TNG device certificate. Certificate can be variable size, so this gives an appropriate buffer size when reading the certificate. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">max_cert_size</td><td>Maximum certificate size will be returned here in bytes.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ATCACERT_E_SUCCESS on success, otherwise an error code. </dd></dl>

</div>
</div>
<a id="ga857aacbb70f2ea18411f1ca478a0e37f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga857aacbb70f2ea18411f1ca478a0e37f">&#9670;&nbsp;</a></span>tng_atcacert_max_signer_cert_size()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int tng_atcacert_max_signer_cert_size </td>
          <td>(</td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>max_cert_size</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the maximum possible certificate size in bytes for a TNG signer certificate. Certificate can be variable size, so this gives an appropriate buffer size when reading the certificate. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">max_cert_size</td><td>Maximum certificate size will be returned here in bytes.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ATCACERT_E_SUCCESS on success, otherwise an error code. </dd></dl>

</div>
</div>
<a id="ga22c7ea083197410f396d18fa808e8e0c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga22c7ea083197410f396d18fa808e8e0c">&#9670;&nbsp;</a></span>tng_atcacert_read_device_cert()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int tng_atcacert_read_device_cert </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>cert</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>cert_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>signer_cert</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads the device certificate for a TNG device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">cert</td><td>Buffer to received the certificate (DER format). </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">cert_size</td><td>As input, the size of the cert buffer in bytes. As output, the size of the certificate returned in cert in bytes. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">signer_cert</td><td>If supplied, the signer public key is used from this certificate. If set to NULL, the signer public key is read from the device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ATCACERT_E_SUCCESS on success, otherwise an error code. </dd></dl>

</div>
</div>
<a id="ga82d3c529ed81119a956957052c06e8d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga82d3c529ed81119a956957052c06e8d7">&#9670;&nbsp;</a></span>tng_atcacert_read_signer_cert()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int tng_atcacert_read_signer_cert </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>cert</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>cert_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads the signer certificate for a TNG device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">cert</td><td>Buffer to received the certificate (DER format). </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">cert_size</td><td>As input, the size of the cert buffer in bytes. As output, the size of the certificate returned in cert in bytes.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ATCACERT_E_SUCCESS on success, otherwise an error code. </dd></dl>

</div>
</div>
<a id="ga31cf63afba3c936d279a325d71691a68"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga31cf63afba3c936d279a325d71691a68">&#9670;&nbsp;</a></span>tng_atcacert_root_cert()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int tng_atcacert_root_cert </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>cert</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>cert_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the TNG root cert. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">cert</td><td>Buffer to received the certificate (DER format). </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">cert_size</td><td>As input, the size of the cert buffer in bytes. As output, the size of the certificate returned in cert in bytes.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ATCACERT_E_SUCCESS on success, otherwise an error code. </dd></dl>

</div>
</div>
<a id="gaa3a0387ff2a71684a2992d4661c53331"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa3a0387ff2a71684a2992d4661c53331">&#9670;&nbsp;</a></span>tng_atcacert_root_cert_size()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int tng_atcacert_root_cert_size </td>
          <td>(</td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>cert_size</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the size of the TNG root cert. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">cert_size</td><td>Certificate size will be returned here in bytes.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ATCACERT_E_SUCCESS on success, otherwise an error code. </dd></dl>

</div>
</div>
<a id="ga8cd0d450da1bf23d0f6784446d35c556"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8cd0d450da1bf23d0f6784446d35c556">&#9670;&nbsp;</a></span>tng_atcacert_root_public_key()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int tng_atcacert_root_public_key </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>public_key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the root public key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">public_key</td><td>Public key will be returned here. Format will be the X and Y integers in big-endian format. 64 bytes for P256 curve.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ATCACERT_E_SUCCESS on success, otherwise an error code. </dd></dl>

</div>
</div>
<a id="gaa4c31ab35807d8ed51fbecc48866aa04"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa4c31ab35807d8ed51fbecc48866aa04">&#9670;&nbsp;</a></span>tng_atcacert_signer_public_key()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int tng_atcacert_signer_public_key </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>public_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>cert</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads the signer public key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">public_key</td><td>Public key will be returned here. Format will be the X and Y integers in big-endian format. 64 bytes for P256 curve. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cert</td><td>If supplied, the signer public key is used from this certificate. If set to NULL, the signer public key is read from the device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ATCACERT_E_SUCCESS on success, otherwise an error code. </dd></dl>

</div>
</div>
<a id="ga6bdd6b8ace7a98b7efbc13f85ffaac1a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6bdd6b8ace7a98b7efbc13f85ffaac1a">&#9670;&nbsp;</a></span>tng_get_device_pubkey()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00173.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> tng_get_device_pubkey </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>public_key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Uses GenKey command to calculate the public key from the primary device public key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">public_key</td><td>Public key will be returned here. Format will be the X and Y integers in big-endian format. 64 bytes for P256 curve.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ATCA_SUCCESS on success, otherwise an error code. </dd></dl>

</div>
</div>
<a id="ga421d9b1fd3aba60c947d6b3efb122390"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga421d9b1fd3aba60c947d6b3efb122390">&#9670;&nbsp;</a></span>tng_get_type()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00173.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> tng_get_type </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00997.html#ga91acea350b146040fc32c64eac8054f7">tng_type_t</a> *&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the type of TNG device. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">type</td><td>TNG device type is returned here.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ATCA_SUCCESS on success, otherwise an error code. </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="ga5c01e37d1f10dbf90d50208cbc5bc8ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5c01e37d1f10dbf90d50208cbc5bc8ab">&#9670;&nbsp;</a></span>g_cryptoauth_root_ca_002_cert</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const uint8_t g_cryptoauth_root_ca_002_cert[]</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="gabff789f84f8f178a30ce06792fe47771"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabff789f84f8f178a30ce06792fe47771">&#9670;&nbsp;</a></span>g_cryptoauth_root_ca_002_cert_size</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const size_t g_cryptoauth_root_ca_002_cert_size</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="gaecb2b4ecc54a70681f2f254f26b5a7e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaecb2b4ecc54a70681f2f254f26b5a7e3">&#9670;&nbsp;</a></span>g_tng22_cert_def_1_signer</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="a00990.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a> g_tng22_cert_def_1_signer</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ga40641ac9348b3b54bb30ba27a52a5a0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga40641ac9348b3b54bb30ba27a52a5a0e">&#9670;&nbsp;</a></span>g_tng22_cert_def_2_device</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="a00990.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a> g_tng22_cert_def_2_device</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ga0aa08fbe28f95e963992360b558df183"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0aa08fbe28f95e963992360b558df183">&#9670;&nbsp;</a></span>g_tngtn_cert_def_1_signer</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="a00990.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a> g_tngtn_cert_def_1_signer</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="gaa57e70cff7fe086c68527e2e8b284074"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa57e70cff7fe086c68527e2e8b284074">&#9670;&nbsp;</a></span>g_tngtn_cert_def_2_device</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="a00990.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a> g_tngtn_cert_def_2_device</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
